Repository navigation
Cookie settings: explain when the consent tool is blocked - #45
Merged
Merged
Conversation
Ad blockers usually block Google's consent tool, so the Cookie settings link silently did nothing. If the tool hasn't run 2.5 s after the click, a short note says it's blocked, that Analytics doesn't load then, and that there's no consent to change.
|
Codex review: - if the consent tool answered after 2.5 s, the note stayed up although the settings opened; the callback now clears the timer and removes a shown note (and a flag covers callbacks that run inside push) - 'there's no consent to change' was wrong for visitors with an earlier choice; the note now says the settings can't be opened here and that any earlier choice stays as it was - the note uses calc(100vw - 2rem) up to 32rem, instead of half the screen width on phones
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Ad blockers and privacy extensions usually block Google's consent tool (
fundingchoicesmessages.google.com). The footer's Cookie settings link only asks that tool to reopen its message, so in such browsers the link silently did nothing and looked broken. Franz noticed it in his normal browser; in incognito, without extensions, it worked.What changes
The click handler still queues
googlefc.showRevocationMessage(). If that callback hasn't run 2.5 seconds after the click, a small note appears at the bottom of the screen for 12 seconds:The note doesn't claim that no ads load. A blocker might block only the consent tool, and outside Europe ads don't depend on consent. Analytics, though, never starts without the consent tool: the adapter waits for its callback.
Testing
Local build in Chromium:
adsbygoogle.jsblocked, the note appears.showRevocationMessageruns and no note appears.